<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="core" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h1>测试4种许可类型</h1><br>
<button id="goToAuth">授权码许可（最安全，最全面，使用最广放的一种许可类型）</button><br><br>
<button id="resourceOwner">测试资源拥有者凭据许可</button><br><br>
<button id="clientCredential">客户端凭据许可</button><br><br>
<button id="implicitPermit">隐式许可</button><br><br><br>
</body>
</html>
<script type="text/javascript">
    document.getElementById("goToAuth").onclick = function() {
        let authServerUrl = "http://localhost:8899/authServer/goToAuthPage?response_type=code&redirect_uri=" + encodeURI("http://localhost:8899/client/receiveAuthCode") + "&app_id=APPID_RABBIT&scope=today history";
        console.log("去三方服务器授权了");
        window.location.href = authServerUrl;
    }

    document.getElementById("resourceOwner").onclick = function() {
        window.location.href = "http://localhost:8899/otherThree/resourceOwnerBegin";
    }

    document.getElementById("clientCredential").onclick = function() {
        window.location.href = "http://localhost:8899/otherThree/clientCredentialClient";
    }

    document.getElementById("implicitPermit").onclick = function() {
        window.location.href = "http://localhost:8899/otherThree/implicitPermitClient";
    }
</script>
